/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.liquidByte.trafficMustang.server.dataModel;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Alexandre
 */
@Entity
@Table(name = "tran_tp")
public class TransacaoTipo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "TRAN_TP_ID")
    private Short tranTpId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "TRAN_TP_DSC")
    private String tranTpDsc;

    public TransacaoTipo() {
    }

    public TransacaoTipo(Short tranTpId) {
        this.tranTpId = tranTpId;
    }

    public TransacaoTipo(Short tranTpId, String tranTpDsc) {
        this.tranTpId = tranTpId;
        this.tranTpDsc = tranTpDsc;
    }

    public Short getTranTpId() {
        return tranTpId;
    }

    public void setTranTpId(Short tranTpId) {
        this.tranTpId = tranTpId;
    }

    public String getTranTpDsc() {
        return tranTpDsc;
    }

    public void setTranTpDsc(String tranTpDsc) {
        this.tranTpDsc = tranTpDsc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tranTpId != null ? tranTpId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransacaoTipo)) {
            return false;
        }
        TransacaoTipo other = (TransacaoTipo) object;
        if ((this.tranTpId == null && other.tranTpId != null) || (this.tranTpId != null && !this.tranTpId.equals(other.tranTpId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.liquidByte.trafficMustang.server.dataModel.TransacaoTipo[ tranTpId=" + tranTpId + " ]";
    }
    
}
